package org.sucri.floxs.model;

import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * Created by IntelliJ IDEA.
 * User: Wen Yu
 * Date: Aug 9, 2007
 * Time: 9:58:59 PM
 * To change this template use File | Settings | File Templates.
 */
@Inherited
@Retention(RetentionPolicy.RUNTIME)
public @interface Accesor
{
  String NULL = "nUlL";
  
  enum Mode   { getter, setter };
  enum Editor { string, bool, number, time, date, collection, object, password, array, money }
  enum Align  { left, right, center, justify, none }

  Mode         mode() default Mode.getter;
  Editor     editor();
  Align       align() default Align.none;

  int      width_px() default 0;
  int         order() default 0;
  int   order_minor() default 0;
  
  String     header();
  String     format() default NULL; // printf specification
  String    choices() default NULL; // selection from SQL select or method call
  String    sortKey() default NULL;
  String      group() default NULL;
  String    tooltip() default NULL; // contents to be shown in a toolip

  boolean isSummary() default false;
  boolean   inherit() default false; // include super class?
  boolean   isDebug() default false; // only active in debug mode?
  boolean    isHtml() default false;
  boolean  sortable() default true;
  boolean resizable() default true;
  boolean    locked() default false;
  boolean    hidden() default false;

  // only relevant if the mode is 'setter'
  boolean  nullable() default true;
  boolean  multiple() default false;
  boolean   mutable() default true;
  String  subscribe() default NULL;
  String     depend() default NULL; // a function name, only render the field if return is true
}
